package com.sap.test;

import org.junit.jupiter.api.Test;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
public class Redisson {

    @Autowired
    private RedissonClient redissonClient;
    @Test
    public void test() {
        RLock lock = redissonClient.getLock("lock");
        try {
            lock.tryLock();
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            lock.unlock();
        }
    }
}
